package com.example.lianxirenlist;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import java.nio.Buffer;
import java.util.List;

public class MainActivity extends AppCompatActivity {
ListShuJuKu helder;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        intiview();
    }
    private void  intiview(){
        Button button=findViewById(R.id.butt_finish);
        RecyclerView recy=findViewById(R.id.recy_list);
        helder = new ListShuJuKu(this, "Persion", null, 1);
        recy.setLayoutManager(new LinearLayoutManager(this));
        List<DataBean> list=helder.select();
        MyAdaper adaper=new MyAdaper(this);
        adaper.setData(list);
        recy.setAdapter(adaper);
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(MainActivity.this,Add.class);
                startActivity(intent);

            }
        });
    }
}